Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String parsing analyzer to replace regex split, enables ^CC and ^CT commands #189

Merged
merged 3 commits into from
Sep 18, 2023

Conversation

reportingissue
Copy link
Collaborator

@reportingissue reportingissue commented Sep 15, 2023

ZPL ^FD commands sometimes come with ^ and ~ characters in the data. This breaks the parser which sees unrecognized commands. The way these are stored is by swapping out the caret(CC) or tilde(CT) characters with an unused one momentarily before reading the FD data, then swapping back the original symbol(s) after.

This still returns an array of strings like the old SplitZplCommands signature.

We patch back the commands with the default caret and tilde so that the command analyzers do not have to be modified.

The capacity sizes for the buffers are arbitrary, but what I'd consider a reasonable amount for shipping labels.

Ideally, there would be work to support the ^CSCD command as well, but because most command analyzers rely on splitting on commas, there are architectural discussions to be had prior.

Reporting Issue added 3 commits September 14, 2023 21:15
- Fixed looping over wrong string
- Regex cleaning
- Empty, null or whitespace string check
- style: camel case, longer variable names
@YipingRuan YipingRuan merged commit 1353cae into BinaryKits:master Sep 18, 2023
2 checks passed
@YipingRuan
Copy link
Contributor

@reportingissue
Let me know a good time to increase version number

@reportingissue
Copy link
Collaborator Author

@reportingissue Let me know a good time to increase version number

We're working off our forked version of BinaryKits.Zpl.Label.dll and BinaryKits.Zpl.Viewer.dll, so a version increase does not matter to us. You are free to increment the version number for the other users using it through Nuget if you deem the changes made significant and useful enough. For our self serving needs though, we'd have a {temporary) version based off the master branch of Zxing.net to get stable and correct code128 barcodes so I don't have to juggle 3 solutions.

I have other PRs I'd like to publish, but they are not functionality related and might require more thorough reviewing and testing, thus marking them more for the next version.

Incrementing the version now would include dependency upgrades benefits for the skiasharp and barcodelib 2.4 -> 3.0, even though I know we want to drop it.

So I'd say go ahead whenever you feel like it.

@reportingissue reportingissue deleted the string-parsing-analyzer branch September 18, 2023 16:58
@YipingRuan
Copy link
Contributor

@reportingissue
Glad the tool has helped for your task.
Maybe we increase version after your other PRs. Added you to the repo team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants